package per.sunmes.cl.g.actor.ef;

import per.sunmes.cl.g.sys.U;

import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class BlendPic extends Actor {

	TextureRegion region;

	public BlendPic(TextureRegion region) {
		this.region = region;
		setSize(region.getRegionWidth(), region.getRegionHeight());
	}

	int oldSrc, oldDst;

	@Override
	public void draw(Batch batch, float parentAlpha) {
		oldSrc = batch.getBlendSrcFunc();
		oldDst = batch.getBlendDstFunc();
		batch.setBlendFunction(BlendDraw.BLEND_SRC, BlendDraw.BLEND_DST);
		U.drawRegionByActor(batch, region, this, parentAlpha);
		batch.setBlendFunction(oldSrc, oldDst);
	}

}
